<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>京东商城 - 用户登录</title>

    <style>
        /* Global styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", Arial, sans-serif;
        }

        body {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        /* Login container styles */
        .login-container {
            display: flex;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            width: 800px;
        }

        /* Captcha area styles */
        .captcha-area {
            width: 350px;
            padding: 30px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border-right: 1px solid #eee;
        }

        .captcha-title {
            font-size: 18px;
            color: #666;
            margin-bottom: 20px;
        }

        .captcha-image {
            width: 200px;
            height: 80px;
            margin-bottom: 20px;
            cursor: pointer;
            border: 1px solid #ddd;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            color: #333;
            background-color: #f9f9f9;
            user-select: none;
        }

        .captcha-tip {
            font-size: 14px;
            color: #999;
            text-align: center;
        }

        /* Login box styles */
        .login-box {
            width: 450px;
            padding: 40px;
        }

        .login-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .login-header h2 {
            font-size: 24px;
            color: #e4393c;
            font-weight: normal;
            margin-bottom: 10px;
        }

     /* 登录表单输入框样式 */
        .login-form input {
            width: 100%;
            height: 40px;
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
            outline: none;
            transition: border-color 0.3s;
        }
        /* 输入框获得焦点的样式 */
        .login-form input:focus {
            border-color: #e4393c;
        }

      /* 验证码 */
        .captcha-input-container {
            display: flex;
            margin-bottom: 15px;/*设置验证码输入容器底部的外边距为15像素，以确保与其他元素之间有足够的间距。 */
        }

        .captcha-input {
            flex: 1;
            margin-right: 10px;
        }
/* 验证码刷新按钮样式 */
        .captcha-refresh {
            width: 100px;
            background: #f5f5f5;/*设置验证码刷新按钮的背景颜色为浅灰色（#f5f5f5）。 */
            border: 1px solid #ddd;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 14px;
            color: #666;
        }

        .captcha-refresh:hover {
            background: #eee;
        }

        /* Login actions area */
        .login-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            font-size: 14px;
        }

        .remember-me {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .remember-me input[type="checkbox"] {
            margin:0;
            width: auto;
            vertical-align: middle;
            position: relative;
            top: 1px;
        }

        .remember-me label {
            cursor: pointer;
            line-height: normal;
            vertical-align:middle;
        }

        .forget-pwd {
            color: #999;
            text-decoration: none;
            line-height: normal;
            vertical-align: middle;
            padding: 2px 0;
        }

        .forget-pwd:hover {
            color: #e4393c;
        }

        /* Login button styles */
        .login-btn {
            width: 100%;
            height: 42px;
            background: #e4393c;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
            margin-bottom: 20px;
            transition: background 0.3s;
        }

        .login-btn:hover {
            background: #c91623;
        }

        /* Register area styles */
        .register-area {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #eee;
        }

        .register-link {
            color: #e4393c;
            text-decoration: none;
            margin-left: 5px;
        }

        .register-link:hover {
            text-decoration: underline;
        }

        /* Error message styles */
        .error-message {
            color: #e4393c;
            margin-bottom: 15px;
            padding: 8px 12px;
            background-color: #ffeeee;
            border-radius: 4px;
            display: none;
        }

        /* Custom message box styles */
        .custom-message-box {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
            z-index: 1000;
            font-size: 16px;
            text-align: center;
            min-width: 250px;
            opacity: 0;
            transition: opacity 0.3s ease-in-out;
        }

        .custom-message-box.error {
            background-color: #ffeeee;
            color: #e4393c;
        }

        .custom-message-box.success {
            background-color: #e6ffe6;
            color: #3c933c;
        }

        .custom-message-box.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="captcha-area">
            <div class="captcha-title">验证码展示区</div>
            <div class="captcha-image" id="mainCaptcha">点击更换</div>
            <div class="captcha-tip">点击验证码图片可更换验证码</div>
        </div>

        <div class="login-box">
            <div class="login-header">
                <h2>京东欢迎您</h2>
            </div>

            <div class="login-form">
                <input type="text" placeholder="用户名/邮箱/手机号" id="username">

                <div class="captcha-input-container">
                    <input type="text" placeholder="验证码" class="captcha-input" id="captcha">
                    <div class="captcha-refresh" id="refreshCaptcha">换一张</div>
                </div>

                <input type="password" placeholder="密码" id="password">

                <div class="error-message" id="errorMessage"></div>

                <div class="login-actions">
                    <div class="remember-me">
                        <input type="checkbox" id="remember">
                        <label for="remember">记住用户名</label>
                    </div>
                    <a href="#" class="forget-pwd">忘记密码</a>
                </div>

                <button class="login-btn" id="loginBtn">登&nbsp;&nbsp;录</button>
            </div>

            <div class="register-area">
                还没有账号？<a href="#" class="register-link" id="registerLink">立即注册</a>
            </div>
        </div>
    </div>

    <script src="./../js/auth.js"></script>
</body>
</html>
